package callback;

/**
 * Created by yiyongyao on 2018/3/2.
 */
public class MyFetcher implements Fetcher {


    final Data data;

    public MyFetcher(Data data) {
        this.data = data;
    }

    @Override
    public void fetchData(FetcherCallback fetcherCallback) {
        try {
            fetcherCallback.onData(data);
        } catch (Exception e) {
            fetcherCallback.onError(e);
        }

    }
}
